package xdu.lz.netty.g_handler.en_decode;

import io.netty.buffer.ByteBuf;
import io.netty.channel.ChannelHandlerContext;
import io.netty.handler.codec.MessageToByteEncoder;

/**
 * @author lizhen
 * @date 2019/8/23 14:30
 * @desc  出栈编码处理器
 */
public class MyLongToByteEncoder extends MessageToByteEncoder<Long> {

    @Override
    protected void encode(ChannelHandlerContext ctx, Long msg, ByteBuf out) throws Exception {
        System.out.println("encoder invoke!");

        System.out.println("msg:"+msg);

        out.writeLong(msg);
    }

}
